<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Notre équipe</title>
<?php include('include/include_link.php');?>
<!--302-->
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>engine1/style.css" />
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>css/style303.css" />
<script type="text/javascript" src="<?php echo base_url();?>engine1/jquery.js"></script>
<!--303-->

<style type="text/css">
    #com {
        font-family: verdana;
        font-size: 12px;
        text-align: center;
    }    
</style>
<script type="text/javascript">
$(document).ready(function(){
<?php
foreach ($poster as $key => $manipcom) {
    $id_com = $manipcom['ID_COM'];
    echo "$('#valid".$id_com."').click(function(){";
    echo "$.ajax({";
    echo "url:'".base_url()."comment/validComment?id_com=".$id_com."',";
    echo "cache:false,";
    echo "success:function(data){";
    echo "if(data==1){";
    echo "$('#valid').empty();";
    echo "$('#valid').html('Valid&eacute;');";
    echo "}else{";
    echo "alert('Erreur de validation');}},";
    echo "error:function(XMLHttpRequest,textStatus, errorThrown){";
    echo "alert('erreur');}";
    echo "});";
    echo "});";
    
    
    echo "$('#suppr".$id_com."').click(function(){";
    echo "$.ajax({";
    echo "url:'".base_url()."comment/delComment?id_com=".$id_com."',";
    echo "cache:false,";
    echo "success:function(data){";
    echo "if(data==1){";
    echo "$('#ligne".$id_com."').empty();";
    echo "}else{";
    echo "alert('Erreur de validation');}},";
    echo "error:function(XMLHttpRequest,textStatus, errorThrown){";
    echo "alert('erreur');}";
    echo "});";
    echo "});";


}
?>
 

/*end*/
});
</script>

</head>

<body class="ficheclinique laclinique">
<?php include('include/variable_session.php');?>     
<?php 
$id_cli = $id_clinic;
                $donne_cli = array();
                $donne_cli= $this->mod_clinic->getAllClinicInfo($id_cli);
                foreach($donne_cli as $key => $clinic){
                    $nom_cli = $clinic['NOM_CLI'];
                    $partner = $clinic['PARTNER'];
                }
?>

<div class="main_container">
	<div id="wraper">
        	<?php include('include/header.php');?>  
                <div class="page sizing">           	
                <div class="titre">
                <h1 class=" pull-left"><?php echo $nom_cli;?> 
                 <?php if($partner==1) { echo"<a class='' href='fiche-clinique.html' title='partenaire'>";
                 echo "<img src='".base_url()."images/photo/partenaire.png' title='partenaire' alt='walkdentalcare'/></a>";} ?>
                </h1>
                <div class="clear"></div>
                </div>
                <div class="navbar">
                    <ul>
                        <li><a href="<?php echo base_url().$lg;?>/espace-clinique" title="La clinique">La clinique</a></li>
                        <li"><a href="<?php echo base_url().$lg;?>/espace-clinique/notre-equipe" title="acceuil">Notre équipe</a></li>
                        <li><a href="index.html" title="acceuil">Nos tarifs</a></li>
                        <li class='active'><a href="<?php echo base_url().$lg;?>/espace-clinique/commentaires" title="acceuil">Commentaires</a></li>
                        <li><a href="index.html" title="acceuil">Contacter la clinique</a></li>
                    </ul>
                </div>
                
                    <?php 
            echo "<form>";
            echo "<table border='0' id='com'>";
            echo "<tr>";
            echo "<td>DATE POST</td>";
            echo "<td>PATIENT</td>";
            echo "<td>COMMENTAIRES</td>";
            echo "<td>VALIDER</td>";
            echo "<td>SUPPRIMER</td>";
            echo "</tr>";
            $nbcom=0;
             foreach ($poster as $key => $list) {
                 $nbcom++;
                 $id_com = $list['ID_COM'];
                 $id_pa = $list['ID_PA'];
                 $id_cli = $list['ID_CLI'];
                 $date_post =$list['DATE_POST'];
                 $comment=$this->mod_comment->getCommentById($id_com);
                 $patient = array();
                 $patient = $this->mod_comment->getPatientById($id_pa);
                 foreach ($patient as $key => $pa) {
                 }
                 echo "<tr id='ligne".$id_com."'>";
                 echo "<td>".$date_post."</td>";
                 echo "<td>".$pa['CIVILITE_PA']." ".$pa['NOM_PA']." ".$pa['PRENOM_PA']."</td>";
                 echo "<td>".$comment."</td>";
                 echo "<td id='valid'><input type='button' id='valid".$id_com."' value='VALIDER' /></td>";
                 echo "<td id='suppr'><input type='button' id='suppr".$id_com."' value='SUPPRIMER' /></td>";
                 echo "</tr>";


             }
             echo "</table>";
             echo "</form>";
            echo "<input type='hidden' id='nbcom' value='".$nbcom."'/>";
            ?>
                    
                    
                    
                    
        </div>
    </div>
    <?php include('include/footer.php'); ?>
    </div>   
    <script type="text/javascript" src="<?php echo base_url(); ?>engine1/wowslider.js"></script>
    <script type="text/javascript" src="<?php echo base_url(); ?>eengine1/script.js"></script>   
</body>
</html>
